import Vue from "vue";
import VueRouter from "vue-router";
// 主页
import Home from '@/views/Home'
// 登录页面
import Login from '@/views/Login'
// 欢迎页面
import Welcome from '@/views/Welcome'
// 商品----分类   
import Cate from '@/views/goods/Cate'
// 商品----列表 
import List from '@/views/goods/List'
// import add from '@/views/goods/add'
// 订单
import Order from '@/views/order/Order'
// 管理
import Rights from '@/views/power/Rights'
// 
import Roles from '@/views/power/Roles'
// 用户 user
import Users from '@/views/user/Users'


import Button from '@/components/Button.vue'
import Search from '@/components/Search.vue'

import NotFound from '@/views/404'



// 数据报表
import Report from '@/views/report/Report'


Vue.use(VueRouter)
const routes = [
  { path: '/', redirect: '/login' },
  { path: '/login', component: Login },
  {
    path: '/home',
    component: Home,
    redirect: '/home/welcome',
    children: [
      { path: 'search', component: Search },
      { path: 'button', component: Button },
      { path: 'welcome', component: Welcome },
      { path: 'cate', component: Cate },
      { path: 'list', component: List },
      // { path: 'add', component: add },
      { path: 'order', component: Order },
      { path: 'rights', component: Rights },
      { path: 'roles', component: Roles },
      { path: 'users', component: Users },
      { path: 'report', component: Report },
    ]

  },
  {
    path: '*',
    component: NotFound,
  }
]
const router = new VueRouter({
  routes,
})
export default router